<template>
  <el-dialog
    :title="title"
    :visible.sync="dialogTableVisible"
    @close="closeDialog"
  >
  <!-- <div>人员</div> -->
    <el-table :data="tableData">
      <template v-for="(item,index) in tableHead" >
      <el-table-column
        :property="item.field"
        :label="item.name"
        :key="index"
        show-overflow-tooltip
      ></el-table-column>
      </template>
      <!-- <el-table-column
        property="name"
        label="姓名"
        width="200"
      ></el-table-column>
      <el-table-column property="address" label="地址"></el-table-column> -->
    </el-table>
  </el-dialog>
</template>

<script>
// import { showLoading, hideLoading } from '@/utils'
export default {
  data() {
    return {
      // tableHead: [
      //   {
      //     column_name: 'name', column_comment: '姓名'
      //   },
      //   {
      //     column_name: 'date', column_comment: '日期'
      //   },
      //   {
      //     column_name: 'address', column_comment: '地址'
      //   }
      // ],
      // tableData: [],
      gridData: [
        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }
      ],
      dialogTableVisible: true,
      dialogFormVisible: false
    }
  },
  props: {
    visible: {
      type: Boolean
    },
    tableData: {
      type: Array
    },
    tableHead: {
      tpye: Array
    },
    title: {
      type: String
    }
  },
  created() {
    var that = this
    that.onload()
  },
  methods: {
    onload() {
      console.log('初始化了')
      // showLoading('刷新权限中...')
    },
    closeDialog() {
      console.log('我被关闭了')

      this.$emit('closeDialog', false)
    }
  }
}
</script>
<style>

</style>
